package com.yamanyar.weebill.view;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

import com.yamanyar.weebill.domain.Attachment;
import com.yamanyar.weebill.service.AttachmentService;

/**
 * Lists attachments. Created in Jun 28, 2008.
 * 
 * @author Kaan Yamanyar
 */
@org.springframework.stereotype.Component("listAttachment")
@Scope("request")
public class ListAttachments implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3156916209497186641L;
	private List<Attachment> attachments;
	private AttachmentService attachmentService;

	@Autowired
	public ListAttachments(AttachmentService attachmentService) {
		this.attachmentService = attachmentService;
		attachments = this.attachmentService.findAll();
	}

	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}

}
